/*
 * @Author: your name
 * @Date: 2021-07-09 16:32:36
 * @LastEditTime: 2021-07-21 13:55:17
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \cuiyuan_activity\assets\script\SceneEnd.ts
 */
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

import Game from "./Game";

const { ccclass, property } = cc._decorator;

@ccclass
export default class SceneEnd extends cc.Component {

    static inst: SceneEnd;
    // LIFE-CYCLE CALLBACKS:

    onLoad() {
        SceneEnd.inst = this;
    }

    show() {
        this.node.x = 0;
        this.node.zIndex = 99;
        this.node.active = true;
    }

    hide() {
        this.node.active = false;
    }

    // 返回主场景
    goHome() {
        this.hide();
        Game.inst.nextScene('Begin')
    }

    start() {

    }

    update(dt) {

    }
}
